When encoding an input image using a predetermined bit rate, it is necessary to determine a target amount of code for an encoding target picture and further to determine a quantization width based on a degree of complexity of the encoding target picture. For example, encoding of a (complex) video image including lots of texture parts or a video image including a considerable motion part is relatively difficult and the amount of code generated therefor tends to increase. In contrast, encoding of a video image having less variation in luminance or a video image including no motion part is relatively easy. Accordingly, each video image has an inherit complexity for encoding.
For the complexity of an encoding target picture, most encoding methods estimate it based on a result of encoding such as the amount of code generated for a previously-encoded picture, and then determine the quantization width. That is, with a premise that images having similar characteristics continue, the complexity of the encoding target picture is estimated based on a result of encoding of a previously-encoded picture.
However, in a video image having a considerable variation in video characteristics, usage of a result of encoding of a previously-encoded picture may degrade prediction accuracy, which tends to cause unstable encoding control unstable or inappropriate code amount allocation, thereby degrading the relevant image quality.
Therefore, Patent Document 1 proposes a method for correcting a “complexity index” by using feature values obtained within a previously-encoded picture and an encoding target picture.
That is, when encoding the amount of code generated for the encoding target picture based on a result of the encoding of the previously-encoded picture, the feature value in each of the previously-encoded picture used for the relevant estimation and the encoding target picture is computed, and a complexity index used for the code amount estimation is corrected using the feature values computed within the pictures.
Accordingly, it is possible to stably control the amount of code even for a video image (e.g. fade image) whose complexity gradually varies.
In typical video encoding methods, multiple picture types are defined for different prediction modes such as inter-picture prediction and intra-picture prediction. Since different picture types have different degrees of complexity, an encoding result of the same picture type is used for the complexity estimation.
Patent Document 1 also considers the picture type, and assigns processes to the picture types by switching the operation.
FIG. 4 is a flowchart showing a conventional method of estimating the complex index.
First, a feature value for an encoding target picture is computed (see step S101).
Next, a feature value of any of previously-encoded pictures, which has the same picture type as the encoding target picture is extracted (see step S102).
Additionally, a complex index for the same picture type is extracted (see step S103).
The extracted complex index is corrected using the feature values obtained by steps S101 and S102 (see step S104).
The amount of code generated by encoding of the encoding target picture is controlled using the corrected complex index (see step S105).